1. Field of the Invention
This invention relates to a multi-coding apparatus for encoding a moving picture, for example, in a compressed form and outputting it at a constant bit rate.
2. Description of the Related Art
There are proposed, for example, in U.S. Pat. No. 5,226,093 MPEG (Moving Picture Image Coding Experts Group) and MPEG2 (Moving Picture Image Coding Experts Group Phase 2) as high-efficient coding systems for coding image data into a compressed form by motion-compensative predictive coding and DCT-transformation. In MPEG and MPEG2, I pictures, B pictures and P pictures are sent in a predetermined sequence. For I pictures, video data are transmitted after being DCT-transformed and variable-length-coded. For B pictures, differential data from a current frame or field are sent in a DCT-transformed, variable-length-coded form. For P pictures, differential data between a current frame or field and a motion-compensated preceding frame or field are sent in a DCT-transformed, variable-length-coded form. In transmitting a digital video signal by MPEG or MPEG2, constant-rate control is performed for maintaining a substantially constant transmission rate. The control for establishing a constant bit rate is realized by taking one picture as a block, performing bit allocation for determining a target value for the amount of codes to be generated for each block, and controlling a quantizer in accordance with the target value.
FIG. 1 is a block diagram showing a coding apparatus. Current image data introduced through an input terminal 101 is supplied to a subtracter 102 and to a motion detector 114. The subtracter 102 subtracts output data of a motion compensator 113 from the current image data. Output of the subtracter 102 is DCT-transformed by a two-dimensional DCT converter 103 for (8.times.8) pixels, for example. DCT-transformed image data is quantized by a quantizer 104 and then supplied to a variable-length encoder 105 and to an inverse-quantizer 109. The variable-length encoder 105 changes the length of codes of data in accordance with the appearing occurrences of the data. The variable-length-coded data is supplied to a constant-rate buffer 106. The constant-rate buffer 106 supplies encoded data at a constant rate to an output terminal 107. Output of the constant-rate buffer 106 is also supplied to a constant-rate controller 108. The constant-rate controller 108 determines the scale of quantization for the quantizer 104. More specifically, the constant-rate controller 108 preliminarily allocates an amount of bits to be entered in the constant-rate buffer 106 by coding for a next unit region to be coded subsequently. To comply with the allocated amount of bits, the constant-rate controller 108 controls the width of quantization of the quantizer 104. As a result, encoded data is output from the constant-rate buffer 106 at a constant bit rate.
Output of the constant-rate controller 108 is also supplied to the inverse-quantizer 109. The image data given to the inverse-quantizer 109 undergoes inverse DCT transformation by an inverse-DCT transformer 110 in the opposite process from that executed by the quantizer 104. This data is supplied to an adder 111 and added to predictive image data of a reference frame also supplied to the adder 111 from the motion compensator 113. Output data from the adder 111 is supplied to a frame memory 112. Image data of the reference frame output from the frame memory 112 is supplied to the motion compensator 113 and to the motion detector 114.
Based on the current image data introduced from the input terminal 101 and the image data of the reference frame supplied from the frame memory 112, the motion detector 114 obtains a motion vector of the picture. Detection output from the motion detector 114 is supplied to the motion compensator 113. Based on the detection output from the motion detector 114 and the image data of the reference frame from the frame memory 112, the motion compensator 113 performs motion-compensative prediction. Predicted image data output from the motion compensator 113 is supplied to the subtracter 102 and to the adder 111.
When a plurality of sub-pictures are to be displayed simultaneously on a single picture plane (picture-in-picture display, multi-picture display, or the like), a plurality of such coding apparatuses are used. FIG. 2 shows a system comprising encoders corresponding to n pieces of input data, constant-rate buffers supplied with coded data output from respective encoders, constant-rate controllers for controlling widths of quantization of respective encoders on the basis of outputs from the constant-rate buffers, and a multiplexer supplied with outputs from respective constant-rate buffers. Each encoder in FIG. 2 comprises a DCT transformer, quantizer, or the like, which performs quantization or other processing of motion-compensated data in the same manner as described above.
The n pieces of input data are introduced to corresponding encoders 115a to 115n and encoded for each channel. Coded data processed by the encoders 115a to 115n are supplied to corresponding constant-rate buffers 106a to 106n. The constant-rate buffers 106a to 106n outputs the coded data at constant rates. Outputs of the constant-rate buffers 106a to 106n are also supplied to corresponding constant-rate controllers 108a to 108n. The constant-rate controllers 108a to 108n allocate appropriate amounts of bits to be entered in respective constant-rate buffers 106a to 106n from respective encoders 115a to 115n for a next unit region for coding. The constant-rate controllers 108a to 108n supply control data to the encoders 115a to 115n to control the widths of quantization in accordance with the allocated amounts of bits. As a result, data of respective channels are output from respective constant-rate buffers 115a to 115n at constant rates.
In transmitting a digital video signal by MPEG or MPEG2, constant-rate control is performed for maintaining a substantially constant transmission rate. The control for establishing a constant bit rate conventionally relies on taking one picture as a block, performing bit allocation for determining a target value for the amount of codes to be generated for each block, and controlling a quantizer in accordance with the target value.
That is, as shown in FIG. 3 showing a conventional system, encoded video data are supplied to an output buffer 121. Data on the buffer capacity of the output buffer 121 and data on the amount of sequential generated codes are supplied to a quantizer controller 122. A bit allocator 123 is supplied with data on the bit rate, coding mode, and various past data obtained by actual coding operations. Referring to these data, namely, bit rate, coding mode, and various past data obtained by actual coding operations, the bit allocator 123 determines a target amount of codes to be generated for a subsequently coded block, and allocates an appropriate number of codes. Output from the bit allocator 123 is supplied to the quantizer controller 122. The quantizer controller 122 controls the quantizer on the basis of data sent from the buffer 121 to indicate the occupied amount of the buffer, data on the amount of sequential generated codes in one block, and data sent from the bit allocator 123 to inform of the amount of bits allocated to the entire block. The control for establishing a constant bit rate is thus attained.
As explained above, encoded data of respective channels are output at constant rates. That is, encoded data made by multiplexing outputs of respective channels is output at a constant rate without exceeding the maximum capacity of the transmission channel. When multi-coded data is transmitted, each channel outputs its data in a quantized form at a constant bit rate even when respective sub-pictures have different amounts of data at a specific point of time. Therefore, data of respective channels, which will be reproduced into sub-pictures with different qualities depending on their bit rates, are multiplexed and sent out. Assume here, for example, that all sub-pictures, multiplexed, are equal in dimension. If a common output rate is given to all channels of these multiplexed sub-pictures and if amounts of pre-coded data are different for respective channels, respective divisional sub-pictures will be different in amount of reduction of quantized data. This makes it impossible to maintain a uniform subjective quality of the reproduced sub-pictures over the entire picture plane. Additionally, if the respective sub-pictures are different in entropy, a large difference may exist in amount of reduction of information between the respective sub-pictures, due to the code amount reducing function by quantization, which may invite an unbalanced subjective quality of picture among these reproduced sub-pictures. Such differences in subjective quality of picture among respective sub-picture planes is liable to decrease the quality of picture as a whole.
In view of the problems discussed above, it is an object of the invention to provide a multi-coding apparatus capable of quantizing each input data at an independent variable rate and hence preventing deterioration of the quality of picture.
Moreover, as explained above, the control for establishing a constant bit rate conventionally relied on bit allocation using past data. This method, however, sometimes falls in inadequate bit allocation when pictures include a change of scene; when image data including violent and quick motions are to be encoded; or when audio signals having small correlations between adjacent unit regions for coding are to be encoded. This makes it difficult to generate an appropriate amount of codes in compliance with the nature of block data variable from time to time, and hence invites deterioration in quality of reproduced signals.
It is therefore another object of the invention to provide a coding apparatus capable of generating an appropriate amount of codes in compliance with the nature of block data variable from time to time by executing bit allocation using estimated data for future blocks coming after a block currently under the coding process.